#include<stdio.h>
#include<iostream>
using namespace std;
const int M=1e9+7;
long long m,h,i=2,pre=2;
int main(){
	scanf("%lld",&m);
	if(m<=2){
		printf("%lld\n",m);
		return 0;
	}
	while(1){
		if((i*i+i)/2>=m){
			if((i*i+i)/2==m)
				printf("%lld\n",i);
			else
				printf("%lld\n",i-1+m-((i*i-i)/2));
			return 0;
		}
		i++;
	}
}
